<script>
    $(function(){
        if(<?=$orderFirst['napa_stores_num']?>) {
            $('#napa_stores_num').val(<?=$orderFirst['napa_stores_num']?>);
        }
    });
function myform_submit() {

    return true;
}
</script>
<!--菜单 start-->
<?php $this->load->view('defaults/common/left');?>
<!--菜单 end-->
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
        <h1><?=lang('menu_ddgl')?></h1>
        <?=$this->breadcrumb->generateHTML();?>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-pencil"></i>编辑订单</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <form class="form-horizontal" action="<?=blang_url('orders/Order_new/'.$post_type)?>" method="post" name="productform" onsubmit="return myform_submit()" autocomplete="off" style="overflow: hidden;">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">订单概况</label>
                            <div class="col-sm-10">
                                <table class="table table-bordered table-hover oms-table" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th class="text-left"><?=lang('order_fwzx')?></th>
                                            <th class="text-left"><?=lang('order_wxlx')?></th>
                                            <th class="text-right"><?=lang('order_wxdh')?></th>
                                            <th class="text-right"><?=lang('order_lydh')?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="text-left"><?=$orderFirst['serviceCenter_name']?></td>
                                        <td class="text-left"><?=$orderFirst['serviceType_name']?></td>
                                        <td class="text-right"><?=$orderFirst['order_num']?></td>
                                        <td class="text-right"><?=$orderFirst['source_oid']?></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <?php if($role=='admin'):?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><label class="red">*</label><?=lang('order_zt')?></label>
                            <div class="col-sm-10">
                              <select class="form-control" name="status_id" id="statusID">
                                    <?php foreach ($statusList as $rs):?>
                                        <option value="<?=$rs['id']?>" <?=$optStatus[$rs['id']]?> >
                                            <?=$rs['name_'.$curLang]?>
                                        </option>
                                    <?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <?php endif;?>
                        <?php if($orderFirst['service_type']==4):?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('order_fxdh')?></label>
                            <div class="col-sm-10">
                              <input class="form-control" name="rework_orderNum"  value="<?=$orderFirst['rework_orderNum']?>" size="40" placeholder="上次的维修单号"/>
                            </div>
                        </div>
                        <?php endif;?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('order_ddzt')?></label>
                            <div class="col-sm-10">
                                <label class="oms-radio">
                                    <input type="radio" name="available" value="0" <?=$ckdAvailable['0']?>  />failed
                                </label>
                                <label class="oms-radio">
                                    <input type="radio" name="available" value="1"  <?=$ckdAvailable['1']?> />normal
                                </label>
                                <label class="oms-radio">
                                    <input type="radio" name="available" value="2"  <?=$ckdAvailable['2']?> />hold
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">shipinTrack</label>
                            <div class="col-sm-10">
                                <input class="form-control" name="shipinTrack" value="<?=$orderFirst['shipinTrack']?>" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">shipoutTrack</label>
                            <div class="col-sm-10">
                                <input class="form-control" name="shipoutTrack" value="<?=$orderFirst['shipoutTrack']?>" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><label class="red">*</label><?=lang('order_khxm')?></label>
                            <div class="col-sm-10">
                              <input class="form-control" name="consumer_name" value="<?=$orderFirst['consumer_name']?>" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><label class="red">*</label><?=lang('order_khdh')?></label>
                            <div class="col-sm-10">
                              <input class="form-control" name="consumer_phone" value="<?=$orderFirst['consumer_phone']?>" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><label class="red">*</label><?=lang('order_khyx')?></label>
                            <div class="col-sm-10">
                              <input class="form-control" name="consumer_email" value="<?=$orderFirst['consumer_email']?>" size="28"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('pickup_method')?></label>
                            <div class="col-sm-10">
                               <label class="oms-radio">
                                    <input type="radio" name="pickup_service" value="0"  <?=$ckdPickup['0']?>  /><?=lang('pickup_method_smqj')?>
                                </label>
                                <label class="oms-radio">
                                    <input type="radio" name="pickup_service" value="1"  <?=$ckdPickup['1']?>  /><?=lang('pickup_method_khzf')?>
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('order_sjdz')?></label>
                            <div class="col-sm-10">
                               <textarea class="form-control" name="pickup_address"><?=trim($orderFirst['pickup_address'])?></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('delivery_method')?></label>
                            <div class="col-sm-10">
                               <label class="oms-radio">
                                    <input type="radio" name="delivery_service" value="0"  <?=$ckdDelivery['0']?>  /><?=lang('delivery_method_zq')?>
                                </label>
                                <label class="oms-radio">
                                    <input type="radio" name="delivery_service" value="1"  <?=$ckdDelivery['1']?> /><?=lang('delivery_method_kd')?>
                                </label>
                            </div>
                        </div>
                        <div class="form-group" style="display:none;">
                            <label class="col-sm-2 control-label"><?=lang('order_shdz')?></label>
                            <div class="col-sm-10">
                               <textarea class="form-control" name="delivery_address" disabled><?=trim($orderFirst['delivery_address'])?></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><label class="red">*</label><?=lang('order_fhcountry')?></label>
                            <div class="col-sm-10">
                               <select class="form-control" name="delivery_country" id="deliveryCountryId">
                                    <?php foreach ($countryList as $rs):?>
                                        <option value="<?=$rs['iso']?>" <?=$optDeliveryCountry[$rs['iso']]?> >
                                            <?=$rs['iso']?> | <?=$rs['name_en']?>
                                        </option>
                                    <?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('order_fhdetail')?></label>
                            <div class="col-sm-10">
                               <table class="table table-bordered table-hover oms-table" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th class="text-left"><?=lang('order_fhcity')?></th>
                                            <th class="text-left"><?=lang('order_fhstate')?></th>
                                            <th class="text-right"><?=lang('order_fhstreet')?></th>
                                            <th class="text-right"><?=lang('order_fhzipcode')?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="text-left"><input class="form-control" type="text" name="delivery_city" value="<?=$orderFirst['delivery_city']?>" size="28"/></td>
                                        <td class="text-left"><input class="form-control" type="text" name="delivery_state" value="<?=$orderFirst['delivery_state']?>" size="28"/></td>
                                        <td class="text-right"><input class="form-control" type="text" name="delivery_street_address" value="<?=$orderFirst['delivery_street_address']?>" size="28"/></td>
                                        <td class="text-right"><input class="form-control" type="text" name="delivery_zipcode" value="<?=$orderFirst['delivery_zipcode']?>" size="28"/></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        
                       <?php if(strpos('%**#'.$orderFirst['source_oid'],'OM') == 0 && in_array(strtolower($orderFirst['point']),array('es','fr')) && $orderFirst['arrivalRate']=='100%'){?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?=lang('order_zpjms')?></label>
                            <div class="col-sm-10">
                               <select class="form-control" name="napa_stores_num" id="napa_stores_num">
                                    <option value="">-请选择-</option>
                                    <?php foreach($jList as $row){?>
                                        <option value="<?=$row['id']?>"><?=$row['name']?></option>
                                    <?php }?>
                                </select>
                            </div>
                        </div>
                            
                        <?php }?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                               <input name="id" type="hidden" value="<?=$orderFirst['id']?>" />
                                <input class="btn btn-primary" style="padding:8px 30px;" type="submit" value="<?=lang('public_tj')?>" name="submits" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>

